//
//  Network.h
//  AFNetworking
//
//  Created by admin on 2020/5/13.
//
#import <AFNetworking/AFNetworking.h>
#import <Foundation/Foundation.h>




NS_ASSUME_NONNULL_BEGIN

@interface Network : NSObject
@property(strong, nonatomic) AFHTTPSessionManager *manager;

typedef void(^NetworkEndBlock)(id _Nullable result,  NSError *_Nullable error);


+(Network *)share;

/**
 发送POST请求
 */
-(void)sendPost:(NSString *)url param:(NSDictionary *)param head:(NSDictionary *)head block:(NetworkEndBlock)endblock;

/**
 发送GET请求

 */
-(void)sendGet:(NSString *)url param:(NSDictionary *)param head:(NSDictionary *)head block:(NetworkEndBlock)endblock;
/**
发送PUT请求
*/
-(void)sendPut:(NSString *)url param:(NSDictionary *)param head:(NSDictionary *)head block:(void(^)(NSDictionary *result,NSError *error))block;
-(void)sendDelete:(NSString *)url param:(NSDictionary *)param head:(NSDictionary *)head block:(void(^)(NSDictionary *result,NSError *error))block;

/**
 上传单个图片
 */
//-(void)sendPostImage:(NSString *)url image:(UIImage *)image progress:(void(^)(NSProgress *_Nonnull uploadProgress))progress block:(NetworkEndBlock)endblock;
@end


NS_ASSUME_NONNULL_END
